<%--
  Created by IntelliJ IDEA.
  User: SYHT
  Date: 2017/8/22
  Time: 10:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%--解析表达式--%>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <jsp:include page="dist.jsp"/>
</head>
<body style="background-color: #f6f6f6">
<div class="all">
    <jsp:include page="foreEnd.jsp"/>

    <div class="center">
        <jsp:include page="nav.jsp"/>

        <!--内容-->
        <div class="right" id="all_right">

            <form action="${pageContext.request.contextPath}/CompanyInfo/updateCompanyState.emp" class="big">
                <div class="every_top">
                    <h3>招聘中心</h3> <span>公司管理</span> &nbsp;/ &nbsp;<span>信息管理</span>
                </div>

                <div class="rev_content">

                    <div class="rev_in">
                        <div class="rev_every">
                            <span>公司Id：</span>
                            <input type="text" name="companyId" value="${company.companyId}" class="rev_input" disabled="disabled">
                            <input type="hidden" name="companyId" value="${company.companyId}">
                        </div>
                        <div class="rev_every">
                            <span>登录 Id：</span>
                            <input type="text" name="loginId" value="${company.loginId}" class="rev_input" disabled="disabled">
                            <input type="hidden" name="loginId" value="${company.loginId}">
                        </div>
                        <%--普通input--%>
                        <div class="rev_every">
                            <span>公司名称：</span>
                            <input type="text" name="companyName" value="${company.companyName}"  class="rev_input">
                        </div>

                        <div class="rev_every">
                            <span>城区：</span>
                            <input type="text" name="companyCity" value="${company.companyCity}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>具体地址：</span>
                            <input type="text" name="companySpace" value="${company.companySpace}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>公司地址：</span>
                            <input type="text" name="companyLocation" value="${company.companyLocation}" disabled="disabled" class="rev_input">
                        </div>

                        <div class="rev_every">
                            <span>公司电话：</span>
                            <input type="text" name="companyPhone" value="${company.companyPhone}"  class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>公司规模：</span>
                            <select name="companyScale" value="${company.companyScale}" id="companyScale"  class="rev_sel">
                                <option
                                        <c:if test="${company.companyScale=='0-50'}">selected</c:if> value="0-50">0-50人
                                </option>
                                <option
                                        <c:if test="${company.companyScale=='50-500'}">selected</c:if> value="50-500">
                                    50-500人
                                </option>
                                <option
                                        <c:if test="${company.companyScale=='500-1000'}">selected</c:if> value="500-1000">
                                    500-1000人
                                </option>
                                <option
                                        <c:if test="${company.companyScale=='1000以上'}">selected</c:if> value="1000以上">
                                    1000人以上
                                </option>
                            </select>
                            <%--<input type="text" name="companyScale" value="${company.companyScale}"  class="rev_input">--%>
                        </div>
                        <div class="rev_every">
                            <span>公司性质：</span>
                            <input type="text" name="companyNature" value="${company.companyNature eq 1 ? "国企":company.companyNature eq 2 ? "民营":company.companyNature eq 3 ? "外企":company.companyNature eq 4 ? "政府":""}" disabled="disabled" class="rev_input">
                            <br/><br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="text" name="financing" value="${company.financing}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>执照：</span>
                            <input type="text" name="licence" value="${company.licence}"  class="rev_input" disabled="disabled">
                        </div>
                        <div class="rev_every">
                            <span>执照审核状态：</span>

                            <select name="companyState" value="${company.companyState}" id="companyState" class="rev_sel">
                                <option
                                        <c:if test="${company.companyState=='0'}">selected</c:if> value="0">未提交
                                </option>
                                <option
                                        <c:if test="${company.companyState=='1'}">selected</c:if> value="1">审核中
                                </option>
                                <option
                                        <c:if test="${company.companyState=='2'}">selected</c:if> value="2">通过
                                </option>
                                <option
                                        <c:if test="${company.companyState=='3'}">selected</c:if> value="3">未通过
                                </option>
                            </select>

                            <%--<input type="text" name="companyState" value="${company.companyState eq 0 ? "未提交" : company.companyState eq 1 ? "审核中" : company.companyState eq 2 ? "通过" : company.companyState eq 3 ? "未通过" : ""}"  class="rev_input">--%>
                        </div>
                        <div class="rev_every">
                            <span>企业信息完成度：</span>
                            <input type="text" name="isListing" value="${company.isListing}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>经营领域：</span>
                            <input type="text" name="domain" value="${company.domain}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span>技术选型：</span>
                            <input type="text" name="skill" value="${company.skill}" disabled="disabled" class="rev_input">
                        </div>
                        <div class="rev_every">
                            <span style="float: left">公司简介：</span>
                            <textarea name="companyIntro"  class="rev_text">${company.companyIntro}</textarea>
                        </div>

                        <button class="rev_button2" type="submit">确定</button>
                        <button class="rev_button2" type="button" onclick="clo()">关闭</button>
                        <button class="rev_button2" type="button" isAdopt="f" onclick="adopt()" id="adoptP">审核通过</button>
                        <button class="rev_button2 backtan" type="button">审核未通过</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<div class="backpop" role="alert">
    <div class="backpop_container">
        <div class="allbacktan">
            <span style="float: left">未通过原因：</span><textarea class="pup_text"  id="msgContent"></textarea>
        </div>
        <div>
            <button class="bee_one" type="button" onclick="filed()">确定</button>
            <button class="all_close bee_two">取消</button>
        </div>
        <a href="###" class="all_close tan_close fa fa-remove"></a>
    </div>
</div>
<script src="${pageContext.request.contextPath}/dist/backEnd3/js/tab.js"></script>
<script>
    function clo() {
        this.window.close();
    }
</script>
<script>
    $(function () {
        $('#collapseFour').addClass("panel-collapse collapse in");
        $(".all_center").css("display", "block");     //显示二级导航条
        changeTab5();                               //显示对应二级导航条内容
        $(".center_btn2").css({left: '-50px'});
        $(".center_btn").css({left: '100px'});
        $(".all_center").css({left: '0'});
        $("#all_right").css({left: '110px'});
    });

    function adopt() {
        if($('#adoptP').attr("isAdopt")=="f"){
            $.ajax({
                url:"${pageContext.request.contextPath}/CompanyInfo/adoptCompany.emp",
                data:{companyId:${company.companyId}},
                type:"get",
                dataType:"json",
                success:function (data) {
                    if(data.msg == "ok"){
                        $('#adoptP').html("审核已通过");
                        $('#adoptP').attr("disabled");
                        pmsg();
                    }
                }
            })
        }
    }
    function isAdopt() {
        $.ajax({
            url:"${pageContext.request.contextPath}/CompanyInfo/selAdopt.emp",
            data:{companyId:${company.companyId}},
            type:"get",
            dataType:"json",
            success:function (data) {
                if(data.msg == "ok"){
                    $('#adoptP').attr("isAdopt","t");
                    $('#adoptP').html("审核已通过");
                }else {
                    $('#adoptP').attr("isAdopt","f");
                    $('#adoptP').html("审核通过");
                }
            }
        })
    }
    function pmsg() {
        $.ajax({
            url:"${pageContext.request.contextPath}/xzMsg/companyMsg.emp",
            data:{companyId:'${company.companyId}',companyName:'${company.companyName}'},
            type:"get",
            dataType:"json",
            success:function (data) {
                if(data.msg == "ok"){
                    alert("消息发送成功");
                }else {
                    alert("消息发送失败");
                }
            }
        })
    }
    function filed() {
        $.ajax({
            url:"${pageContext.request.contextPath}/xzMsg/filedCompanyMsg.emp",
            data:{msgContent:$("#msgContent").val(),companyId:'${company.companyId}',companyName:'${company.companyName}'},
            type:"get",
            dataType:"json",
            success:function (data) {
                if (data.msg == "ok"){
                    alert("消息发送成功");
                }else {
                    alert("消息发送失败");
                }
            }
        })
    }
</script>
</body>
</html>
